<%- if @elements.blank? -%>
  <%= render_message do %>
    <%= Alchemy.t(:no_more_elements_to_add) %>
  <% end %>
<%- else -%>
  <%= turbo_frame_tag @element do %>
    <%= alchemy_form_for [:admin, @element], remote: false do |form| %>
      <%= form.hidden_field :page_version_id %>
      <div class="input">
        <%= form.label(:name, class: "control-label required") do %>
          <%= Alchemy.t(:element_of_type) %><abbr>*</abbr>
        <% end %>
        <%= render Alchemy::Admin::ElementSelect.new(
          @elements,
          field_name: form.field_name(:name)
        ) %>
      </div>
      <%= form.hidden_field :parent_element_id, value: @parent_element.try(:id) %>
      <%= form.submit Alchemy.t(:add) %>
    <%- end -%>
  <%- end -%>
<%- end -%>
